package com.forenow.demo.Game;
public class Ifwin {
    public int win(String u1,String u2){
        Goon goon=new Goon();
        JavaBean javaBean=new JavaBean();
        if (u1.equals(u2)) {
            System.out.println("平局！");
            return 0;
        }else{
            if (u1.equals("布")) {
                if (u2.equals("剪刀")) {
                    System.out.println("你赢了");
                    return 1;

                }
                if (u2.equals("石头")) {
                    System.out.println("你输了");

                    return -1;
                }
            }
            if (u1.equals("石头")) {
                if (u2.equals("剪刀")) {
                    System.out.println("你输了");
                    return -1;
                }
                if (u2.equals("布")) {
                    System.out.println("你赢了");
                    return 1;

                }
            }
            if (u1.equals("剪刀")) {
                if (u2.equals("石头")) {
                    System.out.println("你赢了");
                    goon.userscore++;
                    return 1;

                }
                if (u2.equals("布")) {
                    System.out.println("你输了");
                    goon.computerscore++;
                    return -1;
                }
            }

        }
        return 0;
        }

    }

